package com.ning.ems.dao;

import com.ning.ems.entity.Package;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author Ning 242741154@qq.com
 * @date 2020/4/10 10:35
 */
@Repository
public interface PackageDao {

    Integer listTotal(Integer senderProvince,
                      Integer receiverProvince,
                      Integer currState,
                      LocalDateTime startTime, LocalDateTime endTime);

    List<Package> list(Integer senderProvince,
                       Integer receiverProvince,
                       Integer currState,
                       LocalDateTime startTime, LocalDateTime endTime,
                       Integer offset, Integer num);

    Integer myListTotal(Integer user,
                        Integer currState,
                        Boolean withDate,
                        LocalDateTime startTime, LocalDateTime endTime);

    List<Package> myList(Integer user,
                         Integer currState,
                         LocalDateTime startTime, LocalDateTime endTime,
                         Integer offset, Integer num);

    Package get(Integer id);

    int add(Package pkg);

    int delete(Integer id);

    int updateState(Integer id, Integer currState);

}
